package cn.edu.wynu.io;

import java.io.FileInputStream;
import java.io.IOException;

public class InputStreamLearn {
    public static void main(String[] args) throws IOException {
        try (FileInputStream fileInputStream = new FileInputStream("src/cn/edu/wynu/io/test.txt")) {
            byte[] bytes = new byte[1000];
            int n;
            while ((n = fileInputStream.read(bytes)) != -1) {
                System.out.println("读取了" + n + "个字节");
            }
        }

    }
}
